package com.spa.infrastructure.enums.dict;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.spa.infrastructure.annotation.SysDictEnumAnnotation;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
@SysDictEnumAnnotation(key = "userType", desc = "用户类型")
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum UserTypeEnum implements IBaseEnum {

    $10(10, "技师",10,0),
    $20(20, "门店",20,0);

    private final Integer code;

    private final String desc;

    private final Integer sort;

    private final Integer status;

    public static UserTypeEnum byCode(int code){
        for (UserTypeEnum value : UserTypeEnum.values()){
            if (value.getCode() == code){
                return value;
            }
        }
        return null;
    }

}
